using System;

namespace SmartMathLibrary
{
    /// <summary>
    /// Interface to implement a Fraction class.
    /// </summary>
    public interface IFraction
    {
        /// <summary>
        /// Gets or sets the numerator.
        /// </summary>
        /// <value>The numerator.</value>
        long Numerator { get; set; }

        /// <summary>
        /// Gets or sets the denominator.
        /// </summary>
        /// <value>The denominator.</value>
        long Denominator { get; set; }

        /// <summary>
        /// Swaps the components (numerator and denominator).
        /// </summary>
        void SwapComponents();

        /// <summary>
        /// Cancels this fraction to its absolute minimum.
        /// </summary>
        void Cancel();

        /// <summary>
        /// Copies this instance.
        /// </summary>
        /// <returns>Returns a copy of the current instance.</returns>
        Fraction Copy();

        /// <summary>
        /// Raises the specified power to the fraction.
        /// </summary>
        /// <param name="power">The specified power.</param>
        void Pow(int power);

        /// <summary>
        /// Raises the specified power to the fraction.
        /// </summary>
        /// <param name="power">The specified power.</param>
        void Pow(double power);

        /// <summary>
        /// Raises the square root to the fraction.
        /// </summary>
        void Sqrt();

        /// <summary>
        /// Raises the specified root to the fraction.
        /// </summary>
        /// <param name="root">The specified root.</param>
        void Root(int root);

        /// <summary>
        /// Raises the specified root to the fraction.
        /// </summary>
        /// <param name="root">The specified root.</param>
        void Root(double root);

        /// <summary>
        /// Converts the fraction to a decimal number.
        /// </summary>
        /// <returns>The converted decimal number.</returns>
        Decimal ToDecimal();

        /// <summary>
        /// Converts the fraction to a decimal number.
        /// </summary>
        /// <returns>The converted decimal number.</returns>
        Double ToDouble();
    }
}